package com.longge;

public class InsertIntoMaxTree {

    public TreeNode insertIntoMaxTree(TreeNode root, int val) {

        if (root==null){
            return new TreeNode(val);
        }
        if (root.val<val)  {
            TreeNode node = new TreeNode(val);
            node.left=root;
            return node;
        }

        root.left = insertIntoMaxTree(root.left, val);
        return root;
    }
}
